import localeMessageBox from '@/components/message-box/locale/zh-CN';
import localeSettings from './zh-CN/settings';
import localeAPI from '@/views/systemManage/api/locale/zh-CN';
import localeUser from '@/views/systemManage/user/locale/zh-CN';
import localeCompany from '@/views/systemManage/company/locale/zh-CN';
import localeRole from '@/views/systemManage/role/locale/zh-CN';
import localeRule from '@/views/systemManage/rule/locale/zh-CN';
//自动加载
const autoLocle = import.meta.glob('@/views/**/locale/zh-CN.ts', {
  eager: true,
});

function formatModules(_modules: any, result: {}) {
  Object.keys(_modules).forEach((key) => {
    const defaultModule = _modules[key].default;
    if (!defaultModule) return;
    result = Object.assign({}, result, defaultModule);
  });
  return result;
}

export default {
  //一级目录添加国际化
  'menu.dashboard': '概览',
  'menu.systemManage': '系统管理',
  //顶部导航
  'navbar.action.locale': '切换为中文',
  //表格
  'searchTable.operation.create': '新建',
  'searchTable.form.reset': '重置',
  'searchTable.form.search': '查询',
  'searchTable.statusOptions.all': '全部',
  'searchTable.message.loading.updating': '更新中',
  'searchTable.message.loading.update.successful': '更新成功',
  'searchTable.message.loading.adding': '新增中',
  'searchTable.message.loading.add.successful': '新增成功',
  'searchTable.message.loading.deleting': '删除中',
  'searchTable.message.loading.delete.successful': '删除成功',
  'searchTable.message.loading.delete.confirm': '您确定要删除吗？',
  'searchTable.message.loading.resetting': '重置中',
  'searchTable.message.loading.reset.confirm': '您确定要重置密码吗？',
  'searchTable.message.loading.reset.successful': '重置成功',
  // 弹窗
  'modal.helpMessage': '编辑和修改菜单',
  'modal.confirm': '确认',
  'modal.cancel': '取消',
  'modal.selectAll': '全选',
  'modal.collapse' : '收起',
  'modal.expand':'展开',

  'modal.add': '新增',
  'modal.edit': '编辑',
  // 列
  'searchTable.size.mini': '迷你',
  'searchTable.size.small': '偏小',
  'searchTable.size.medium': '中等',
  'searchTable.size.large': '偏大',
  'searchTable.actions.refresh': '刷新',
  'searchTable.actions.density': '密度',
  'searchTable.actions.columnSetting': '列设置',
  ...localeSettings,
  ...localeMessageBox,
  ...localeAPI,
  ...localeUser,
  ...localeRole,
  ...localeRule,
  ...localeCompany,
  ...formatModules(autoLocle, {}),
};
